module Aggregator
  
  module ServiceConstants
    RSS = 0
    DELICIOUS = 1
    DIGG = 2
    X43PLACES = 3
    ALLCONSUMING = 4
    CLIPMARKS = 5
    FLICKR = 6
    LASTFM = 7
    LIVEJOURNAL = 8
    SIMPY = 9
    WORDPRESS = 10
    XANGA = 11
    X43THINGS = 12
    OAI = 13
    YOUTUBE = 14
    CITEULIKE = 15
    GOOGLENEWS = 16
    OPML = 17
    TAG = 18
    TWITTER = 19
    ODEO = 20
    TECHNORATI = 21
    GOOGLEBLOG = 22
  end
  
  module ServiceModel
    
    def self.included(base)
      base.class_eval do
        has_many :feeds
        
        validates_presence_of :uri, :title
        
      end
      base.extend(ClassMethods)
    end
    
    module ClassMethods
      
      def available_services 
        self.find(:all, :order => "services.sequence ASC")
      end
      
    end
    
  end
end
